package com.work.cn.service.impl;

import com.work.cn.mapper.CommentMapper;
import com.work.cn.pojo.Comment;
import com.work.cn.pojo.vo.CommentVo;
import com.work.cn.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentMapper;

    @Override
    public List<CommentVo> getCommentByQuestionId(String questionId) {
        List<CommentVo> commentVos = new ArrayList<>();
        List<Comment> comments = commentMapper.getCommentByQuestionId(questionId);
        List<Integer> CommentList = new ArrayList<>();
        for (Comment comment : comments) {
            Integer commentId = comment.getComment();
            CommentList.add(commentId);
        }
        commentMapper.getrawByComment(CommentList);
        return null;
    }
}
